home *** CD-ROM | disk | FTP | other *** search
/ MacAdvocate 2 / MACADVCT.ISO / mac / Goodies / Fun Stuff / Utilities / UltraFind / AppleScript™ Examples / UTF Get Version < prev   
Text File  |  1996-03-15  |  1KB  |  37 lines

  1. copy (the version of application "UltraFind 2.2") to currentVersion
  2. if currentVersion is less than "2.1.2" then
  3.     display dialog "To run this script you need version 2.1.2 or greater of UltraFind" & return & return & ┬
  4.         "The Current version of UltraFind is only " & currentVersion buttons "Cancel"
  5. else
  6.     tell application "UltraFind 2.2"
  7.         clear
  8.         set the text of fileName of its searchRoutine to "SimpleText"
  9.         set the fileType of its searchRoutine to "APPL"
  10.         scan
  11.     end tell
  12.     
  13.     copy the result to numFiles
  14.     
  15.     if numFiles is greater than 0 then
  16.         repeat with fileNum from 1 to numFiles
  17.             
  18.             tell application "UltraFind 2.2"
  19.                 copy (the fileName of fileRecord fileNum) to fName
  20.                 copy (the fileCreator of fileRecord fileNum) to fCreator
  21.                 copy (the fileType of fileRecord fileNum) to fType
  22.                 copy (the version of fileRecord fileNum) to fVersion
  23.                 if fVersion is equal to "" then set fVersion to "N/A"
  24.                 copy (the accessPath of fileRecord fileNum) to fPath
  25.             end tell
  26.             
  27.             display dialog "Found file " & (fileNum as text) & " of " & (numFiles as text) & return & return & ┬
  28.                 "Filename : " & fName & return & ┬
  29.                 "Creator   : '" & fCreator & "'" & return & ┬
  30.                 "Type        : '" & fType & "'" & return & return & ┬
  31.                 "Version   : '" & fVersion & "'" & return & ┬
  32.                 "Where :" & return & return & fPath
  33.         end repeat
  34.     end if
  35. end if
  36.  
  37.